<template>
  <view class="avatar" :style="styles" @click="tap">
    <image :src="src" class="img" mode="aspectFill"></image>
  </view>
</template>

<script setup>
defineProps({
  src: {
    type: String,
    default: ''
  },
  styles: {
    type: String,
    default: ''
  }
})

const emit = defineEmits(['click']);

function tap(){
  emit('click');
}
</script>

<style lang="scss" scoped>
  .avatar{
    border-radius: 50%;
    overflow: hidden;
    font-size: 0;
  }
</style>